<% @page_title = "Add new borrow rule" %>
<%= stylesheet_link_tag "admin/form", :media => "all" %>

<div class="create-reader-form">
  <h1>Add new borrow rule</h1>
  <div class='content'>
  <%= form_for(:borrow_rule, :url => {:controller => 'admin/borrow_rule', :action => 'create'}) do |f| %>
  	<p><label>Reader group:</label> <%= collection_select :borrow_rule, :role_id, Role.all, :id, :role_name %></p>
  	<p><label>Max number of books:</label><%= f.number_field :max_book %></p>
    <p><label>Number of day to borrow:</label> <%= f.number_field :borrow_time %></p>
    <p><label>Number of day to extend:</label> <%= f.number_field :extended_time %></p>
    <p><label>Punished money:</label><%= f.number_field :punish_money%></p>
    
    <p class='action'><label>&nbsp;</label><%= f.submit :Save %></p>
  <% end %><!-- End form -->
  </div><!-- End .content -->
</div><!-- End .create-reader-form -->

<div class='clear'></div>

  <% if flash[:notice] %>
	<div class='notice'>
		<h2>Notice</h2>
		<div class='content'>
			<%= flash[:notice] %>
			<% flash[:notice] = nil %>
		</div>
	</div>
  <% end %>
  
  <% if @borrow_rule.errors.any? %>
  <div class='errors'>
    <ul class="create-reader-errors">
    <% for message_error in @borrow_rule.errors.full_messages %>
      <li><%= message_error %></li>
    <% end %>
    </ul>
  </div><!-- End .errors -->
  <% end %>











